﻿/*
 *KH21E_VCAN.h
 *
 *Created on:2022-10-19 03:36:12
 *
 *Author:By BMS Developer Team
 *
 *ToolVersion: V1.0.0.9
*/

#ifndef RTW_HEADER_VCAN_h_
#define RTW_HEADER_VCAN_h_
#include <stddef.h>
#ifndef VCAN_COMMON_INCLUDES_
# define VCAN_COMMON_INCLUDES_
#include <string.h>
#include "rtwtypes.h"
#endif

# define VcanMsgMax  33+1//60
/* VCAN_COMMON_INCLUDES_ */
extern uint8_T vcan_vcu_CtrlReq;       /* '<Root>/vcan_vcu_CtrlReq' */
typedef struct
{
    uint8_T Extended;
    uint8_T Length;
    uint8_T Remote;
    uint8_T Error;
    uint32_T ID;
    real_T Timestamp;
    uint8_T Data[8];
}
CAN_msg;
/******************************************************************************/
/*-----------------------Exported Variables/Constants-------------------------*/
/******************************************************************************/
typedef void(*VCAN_MESSAGE_FUNC)(void);
typedef struct
{
	VCAN_MESSAGE_FUNC Caller;
	uint16_T Cyc; //报文周期
	uint8_T Used;
	uint16_T Timestamp;//时间戳
}CanMsgType;

extern CAN_msg CAN_RE_MSG;

extern CanMsgType VCANMsg[VcanMsgMax];
extern void TASK_VCANSend(uint16_T cycle);
extern void VCANSend_FirstSetImmediately(void);
extern void CAN0_Receive(uint32_T ID, uint8_T *Data);

extern void  Debug_Send10MS(void);
extern void Debug_Trans(void);
extern uint8_T Rte_CANRx_VCU_HVPwrCmd;           /* (主接触请求) */
extern uint8_T Rte_CANRx_VCU_LowPwrDownCmd;      /* (下电请求) */
extern uint16_T Rte_CANRx_OBC_ChgCurr;
extern uint8_T Rte_CANRx_OBC_FltSts;
extern uint8_T Rte_CANRx_VCU_LifeCnt;
extern uint8_T Rte_CANRx_FDC_LifeCnt;
extern uint8_T Rte_CANRx_QchgAlow;
extern uint8_T Rte_CANRx_OBC_LifeCnt;
extern uint8_T Rte_CANRx_OBC_LifeCnt1;
extern uint8_T Rte_CANRx_FDCSts;
extern uint8_T Rte_CANRx_CCSts;
extern uint8_T Rte_CANRx_CC1Sts;
extern uint8_T Rte_CANRx_Obc_ChgSts;
extern uint8_T Rte_CANRx_Obc_WakeUp;
extern uint8_T Rte_CANRx_tDuty;
extern uint16_T HW_Version;//更新温探前版本
extern uint8_T Rte_CANRx_VehicleSpeed;
extern uint8_T Rte_CANRx_FDCMaiPosRlySts;



#endif                                 /* RTW_HEADER_VCAN_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
